package com.hk.demo01;

import com.hk.bean.Student;
import com.hk.bean.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author yellow Docter
 * @date 2023 -10-10
 * @desc
 *  spring的 xml的 依赖注入的测试
 */
public class Demo03 {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml");

        User u1 = applicationContext.getBean("u1", User.class);
        System.out.println("u1 = " + u1);
        Student stu = applicationContext.getBean("stu", Student.class);
        System.out.println("stu = " + stu);

    }

}
